package cn.bone.chapter05;

import java.util.Date;

public class LocalVariablesTest {

    private int count = 0;

    public static void main(String[] args){
        LocalVariablesTest test = new LocalVariablesTest();
        int num = 10;
        test.test1();
    }

    public void test1(){
        Date date = new Date();
        String name1 = "superbone";
        String info = test2(date, name1);
        System.out.println(date + name1);
    }

    public String test2(Date dateP, String name2){
        dateP = null;
        name2 = "laofu";
        double weight = 160.5;
        char gender = '男';
        return dateP + name2;
    }

    public void test3(){
        count++;
    }

    public void test4(){
        int a = 0;
        {
            int b = 0;
            b = a + 1;
        }
        int c = a + 1;
    }

    public void testAddOperation(){
        byte i = 15;
        int j = 8;
        int k = i + j;
    }

    public int getSum(){
        int m = 10;
        int n = 20;
        int k = m + n;
        return k;
    }

    public void testGetSum(){
        // 获取上一个栈帧返回的结果，并保存在操作数栈中
        int i = getSum();
        int j = 10;
    }
}
